<?php $this->load->view('admin_home/_header') ?>
<?php $this->load->view('message') ?>

<script type="text/javascript">
  $().ready(function(){
    $("#student_course").addClass("active");

    $('.selectpicker').selectpicker();   
  });

  function check_button_click()
    {
        var id=$(".selectpicker").val();
        if(id!='0')
            location.href="<?php echo site_url('admin_student_course/check').'/'?>"+id;
    }

</script>


<div class="container">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">查询选课情况</h3>
        </div>
        <div class="panel-body">
            <div class="col-lg-9">
                <select class="selectpicker form-control" id="course_select" data-live-search="true">
                    <option value="0">点击选择课程（默认为未选课学生）</option>
                    <?php foreach ($lectures as $item ): ?>
                        <option value="<?=$item['id']?>">
                            <?php echo $item['name']?>
                        </option>
                    <?php endforeach ?>
                </select>
            </div>
            <div class="col-lg-1">
                <button onclick="check_button_click()" class="btn btn-primary">查看</button>
            </div>

        </div>
    </div>
</div>
<div class="container">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">未选课学生列表</h3>
        </div>
        <div class="panel-body">
            <div id="table">
                <table id="performace_table" class="table table-striped table-hover ">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>姓名</th>
                            <th>学号</th>
                            <th>班级</th>
                            <th>任课老师</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if (is_array($students)): ?>
                            <?php $index=1; ?>
                            <?php foreach ($students as $item ): ?>
                            <tr>
                                <td>
                                    <?php echo $index++ ;?></td>
                                <td>
                                    <?php echo $item['student_name']?></td>
                                <td>
                                    <?php echo $item['student_id']?></td>
                                <td>
                                    <?php echo $item['logic_class_name']?></td>
                                <td>
                                    <?php echo $item['teacher_name']?></td>
                            </tr>
                            <?php endforeach; ?>
                        <?php endif ?>
                    </tbody>
                </table>
            </div>

        </div>
    </div>

</div>

<?php $this->load->view('admin_home/_footer')?>